<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set value="${pageContext.request.contextPath}" var="path"
	scope="page" />
<script type="text/javascript" charset="utf-8"
	src="${path}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
	src="${path}/ueditor/ueditor.all.min.js">
</script>
<script type="text/javascript">
	var ue = UE.getEditor('editor');
</script>
<!--发布新闻-->
<div class="main_tag">新闻模块管理>发布新闻</div>
<div class="sysm1_udiv">
	<div
		style="width: 98%; background: #F9F9F9; padding-top: 20px; padding-left: 20px;">
		<table style="width: 99%" id="newstable">
			<tr>
				<td style="width: 10%">新闻标题</td>
				<td style="width: 10%"><select id="kind">
						<option value="android">android</option>
						<option value="css">css</option>
						<option value="html">html</option>
						<option value="ios">ios</option>
						<option value="javaee">javaee</option>
						<option value="javascript">javascript</option>
						<option value="ssh">ssh</option>
						<option value="windows phone">windows phone</option>
				</select></td>
				<td style="width: 60%; padding-right: 30px;"><input id="title"
					type="text" size="40" style="width: 90%" /></td>
			</tr>
			<!--post news detail replaced here-->
			<tr>
				<td colspan="3"><script id="editor" type="text/plain"
						style="width: 95%; height: 400px;"></script></td>
			</tr>
			<tr>
				<td><input id="confirm" type="button" value="发布新闻"
					class="btn_postnews" /></td>
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript">
	$("#confirm").click(function() {
		var kind = $("#kind").val();
		var title = $("#title").val();
		var content = ue.getContent();
		$.post("${path}/AddNewsController", {
			kind : kind,
			title : title,
			content : content
		}, function(data) {
			alert(data);
		});
	});
</script>